test: raise line coverage to 85%+ across 21 of 22 files below threshold - #604
Conversation
Review FindingsReviewed via code-reviewer, security-reviewer, test-writer, and refactor-helper agents against the full diff. Critical (0)None. Warnings (6)[code-reviewer/refactor-helper] [code-reviewer/refactor-helper/test-writer] [refactor-helper] [test-writer] [test-writer] [test-writer] Suggestions (8)
Unaddressed RequirementsNone — all 22 files from issue #603 are addressed; the one remaining gap ( Strengths✓ Pure test-only diff — no production code changes, confirmed by all four agents Summary: 0 critical, 6 warnings, 8 suggestions, 0 unaddressed requirements 🤖 Analysis by Claude |
- pager/error.rs, pushdown.rs, page_source.rs: replace `A || B`-style tautologies (and a to_string()==format!() self-comparison) with exact expected-string assertions. - flatten.rs: add the missing HAVING/compound veto tests that the sibling pushdown.rs already covers for the analogous safety check. - scalar.rs: assert specific AggStep/AggFinal opcodes instead of just "instructions is non-empty" (already implied by the preceding .unwrap()). - vdbe/exec.rs: assert real register state renders in Debug output instead of the tautological "contains the type name" check. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Review Findings AddressedFixed all 6 warnings from the review (58b2fc1):
The 8 suggestions (test-helper duplication across sibling files, fragile Debug-format assertions in
🤖 Analysis by Claude |
…ld (#603) Adds test-only coverage for error Display/From-conversion paths, subquery flatten/pushdown expression-rewrite branches, join ordering, integrity-check branches, parser error paths, printer round-trips, readline dispatch/redraw logic, and VFS/pager edge cases. No production code changes. TOTAL line coverage: 89.22% -> 92.88%. 21 of the 22 files now clear 85%; src/bin/sqlite-rs/readline/term.rs remains at 66% because RawMode::enable's success path, its Drop impl, and read_byte all require a real controlling tty, which `cargo test` never has — flagged per the ticket's carve-out rather than faked with a fragile pty harness. Spend: ~1.4M tokens (workflow fan-out across 17 agents covering the bulk of the files) plus direct follow-up work closing the remaining gaps (flatten.rs, pushdown.rs, readline.rs, term.rs) and fixing clippy/mvl-limit fallout from the generated tests (missing lint allows, two `Box<dyn Error>` uses outside the qualified subset, custom assert macros disallowed by the mvl-limit gate). In line with the issue's "large" estimate. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- pager/error.rs, pushdown.rs, page_source.rs: replace `A || B`-style tautologies (and a to_string()==format!() self-comparison) with exact expected-string assertions. - flatten.rs: add the missing HAVING/compound veto tests that the sibling pushdown.rs already covers for the analogous safety check. - scalar.rs: assert specific AggStep/AggFinal opcodes instead of just "instructions is non-empty" (already implied by the preceding .unwrap()). - vdbe/exec.rs: assert real register state renders in Debug output instead of the tautological "contains the type name" check. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
58b2fc1 to
150e39b
Compare
Summary
Display/From-conversion paths (btree/error.rs,record/error.rs,pager/error.rs), subquery flatten/pushdown expression-rewrite branches (codegen/subquery/{flatten,pushdown,scalar,from_clause}.rs), join ordering (codegen/select/{join_order,join_access,select}.rs), integrity-check branches (integrity.rs), parser error paths (parser/{error,printer}.rs), pager checkpoint (pager/checkpoint.rs), VFS edge cases (vfs/{unix,page_source}.rs), and readline dispatch/redraw/terminal logic (bin/sqlite-rs/readline.rs,bin/sqlite-rs/readline/term.rs,sys/termios.rs).Box<dyn Error>test assertions / a custom-macro test helper into forms themvl-limitqualified-subset gate accepts).Result: TOTAL line coverage 89.22% → 92.88%. 21 of the 22 files now clear 85%.
Remaining gap:
src/bin/sqlite-rs/readline/term.rsstays at 66% (up from 16.67% pre-#603).RawMode::enable's success path, itsDropimpl, andread_byteall require a real controlling tty, whichcargo testnever has. Per the ticket's own acceptance-criteria carve-out ("a genuinely untestable branch... should be flagged, not silently tested around"), this is flagged rather than faked with a fragile pty harness — a real fix would need a vendoredopenpty/pty-allocation helper, which is out of scope for a coverage ticket.Test plan
cargo test --lib— 920 passedcargo test --bins— 52 passedcargo test --test unit_repl_dot_commands— 21 passedmake verify— all gates pass (coverage-gate, deny, mvl-limit, mod-files)make lint— clippy + fmt cleanSpend: ~1.4M tokens (a budgeted
Workflowfan-out across 17 agents for the bulk of the files, per CLAUDE.md's multi-agent budget policy) plus direct follow-up work closing the remaining gaps on 4 files and fixing clippy/mvl-limit fallout from the generated tests. In line with the issue's "large" estimate.Closes #603 (term.rs gap intentionally left open per the ticket's own carve-out — noting here rather than closing silently).